/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.me.entity;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Jayasundara
 */
@Entity
@Table(name = "task_type", catalog = "postgres", schema = "public")
@NamedQueries({@NamedQuery(name = "TaskType.findAll", query = "SELECT t FROM TaskType t"), @NamedQuery(name = "TaskType.findById", query = "SELECT t FROM TaskType t WHERE t.id = :id"), @NamedQuery(name = "TaskType.findByTypeName", query = "SELECT t FROM TaskType t WHERE t.typeName = :typeName")})
public class TaskType implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "id", nullable = false)
    private Integer id;
    @Column(name = "type_name", length = 2147483647)
    private String typeName;
    @OneToMany(mappedBy = "taskTypeId")
    private List<Task> taskCollection;

    public TaskType() {
    }

    public TaskType(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }

    public List<Task> getTaskCollection() {
        return taskCollection;
    }

    public void setTaskCollection(List<Task> taskCollection) {
        this.taskCollection = taskCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TaskType)) {
            return false;
        }
        TaskType other = (TaskType) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.me.entity.TaskType[id=" + id + "]";
    }

}
